package com.liuhongwei.test.builder;



import com.liuhongwei.test.bean.Constants;
import com.liuhongwei.test.utils.DateUtils;

import java.io.BufferedWriter;
import java.io.IOException;


public class BuildComment {

    public static void createClassComment(BufferedWriter bw, String classComment) throws IOException {
        bw.write("/**\n");
        bw.write(" * " + classComment + "\n");
        bw.write(" * @auther: " + Constants.AUTHER_COMMENT + "\n");
        bw.write(" * @date: " + DateUtils.getCurrDate() + "\n");
        bw.write(" */\n");
    }

    public static void createFieldComment(BufferedWriter bw, String comment) throws IOException {
        if (comment == null) {
            return;
        }
        bw.write("\t/**\n");
        bw.write("\t * " + (comment == null ? "" : comment) + "\n");
        bw.write("\t */\n");
    }

}
